﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using GUI.RLAServiceReference;

namespace GUI.ModelLayer
{
    class MyDataTemplateSelector : DataTemplateSelector
        {
            public DataTemplate ButtonTemplate { get; set; }
            public DataTemplate LabelTemplate { get; set; }

            public override DataTemplate SelectTemplate(object item,
                       DependencyObject container)
            {

                Friend friend = (Friend) item;
                if (friend.Requester.UserId == friend.LoggedIUser.UserId)
                {
                    return LabelTemplate;
                }
                return ButtonTemplate;
            }
        }

}
    

